﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>判断页面是否添加了W3C声明</title>
    <script type="text/javascript" language="JavaScript">
        if(document.compatMode === 'CSS1Compat'){
            alert('本文档添加了W3C的声明');
        }else{
            alert('本文档未添加W3C的声明');
        }
    </script>
</head>
<body>

</body>
</html>